#pragma once
#include "cocos2d.h"
#include "UICommon.h"

class UIMusicInfoPanelPage;

class UIMusicInfoPanel :public ClippingNode
{
	public:
	UIMusicInfoPanel() {};
	static UIMusicInfoPanel* create(Size disparea, float tabwidth);

	public:
	Size disparea;
	float tabwidth;
	Size pagearea;

	UIMusicInfoPanelPage* addTabPage(string name, int colcount, int rowcount, bool scrollable = false);
	void setTabButtonActive(int index);
	void displayPageByIndex(int pageindex);

	private:
	LayerColor* tablayer;
	int tabcount = 0;
	vector<UIMusicInfoPanelPage*> tabpages;
	vector<UICButton*> tabbtns;
};

class UIMusicInfoPanelPage :public LayerColor
{
	public:
	UIMusicInfoPanelPage() {};
	static UIMusicInfoPanelPage* create(Size disparea, int colcount, int rowcount, bool scrollable);

	void addItem(Node* item, int col, int row);
	void setScrollable(bool scrollable);

	private:
	Size disparea;
	int rowcount, colcount;
	float itemwidth, itemheight;
	bool scrollable = false;
	vector<Node*> items;
};